package com.tinckay.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.tinckay.common.constant.ProjectConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author Jean
 * @since 2018-10-21
 */
@Data
@TableName("base_storehouse")
@ApiModel(value = "Storehouse对象", description = "浇筑仓体")
@NoArgsConstructor
@AllArgsConstructor
public class Storehouse extends Model<Storehouse> {

    private static final long serialVersionUID = -8822068371939359279L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "所属管节", hidden = true)
    private String pipeCode;

    @ApiModelProperty(value = "仓体编号(yyyy-MM-ddNo/20180101000001)", hidden = true)
    private String code;

    @ApiModelProperty(value = "仓体模型类型 0 标准仓，1 非标准仓")
    private Byte type;

    @NotNull(message = "长度不能为空", groups = ProjectConstant.Save.class)
    @ApiModelProperty(value = "长度")
    private Double length;

    @NotNull(message = "宽度不能为空", groups = ProjectConstant.Save.class)
    @ApiModelProperty(value = "宽度")
    private Double width;

    @ApiModelProperty(value = "左宽")
    private Double leftWidth;

    @ApiModelProperty(value = "右宽")
    private Double rightWidth;

    @NotNull(message = "左高不能为空", groups = ProjectConstant.Save.class)
    @ApiModelProperty(value = "左高")
    private Double height;

    @ApiModelProperty(value = "右高")
    private Double rightHeight;

    @ApiModelProperty(value = "高差")
    private Double heiDifference;

    @NotNull(message = "壁厚不能为空（米）", groups = ProjectConstant.Save.class)
    @ApiModelProperty(value = "壁厚")
    private Double wallThickness;

    @ApiModelProperty(value = "容积")
    private Double cubic;

    @ApiModelProperty(value = "三角区容积")
    private Double abnormityCubic;

    @ApiModelProperty(value = "排气孔高度")
    private Double ventHeight;

    @ApiModelProperty(value = "状态 0未浇筑 1已绑定浇筑计划 2已浇筑完成", hidden = true)
    private Integer state;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(hidden = true)
    private String creator;

    @ApiModelProperty(value = "数据库创建时间", hidden = true)
    private LocalDateTime createTime;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
